/**
 * Created by Cheney on 2017/9/9.
 */
const JNSProtocol = require("../src/net/JNSProtocol")

let jns = new JNSProtocol()
let td1 = jns.pack("hello");

jns.setRequestHandler(function (id, data) {
    console.log(id, data)
})
jns.hook(td1)
for( let i = 0 ; i < 5 ; i++ ){
    jns.hook(jns.pack((Math.random().toString(36))));
}

// 发送损坏的顺序
jns.hook(td1.slice(0, td1.length-1))


for( let i = 0 ; i < 5 ; i++ ){
    jns.hook(jns.pack((Math.random().toString(36))));
}

